/*
 * @Descripttion:
 * @version:
 * @Author: zhaoxiaodong
 * @Date: 2020-09-01 10:08:02
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-02-06 17:51:33
 */
import "babel-polyfill";
import "whatwg-fetch";
import "custom-event-polyfill";
import "core-js/stable/promise";
import "core-js/stable/symbol";
import "core-js/stable/string/starts-with";
import "core-js/web/url";
import Vue from "vue";
import axios from "axios";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "@/assets/styles/base/base.css";
import "@/assets/styles/base/baseClass.scss";
import microAppStart from "./core/app-start";
import { ApiService, Authority } from "cloud-common";
import { $cloudMessage, $cloudConfirm } from "cloud-components";
import CloudMonitor from "cloud-monitor-sdk/dist/cloud-monitor-sdk";

//--------  注册接口服务  ----------------
Vue.prototype.$checkAuth = new Authority("space").checkAuth;
Vue.prototype.api = new ApiService(axios, $cloudMessage, $cloudConfirm, "");
Vue.prototype.$http = axios;
//--------  注册接口服务结束  ----------------

//--------  注册全局过滤器 -------------
import filters from "cloud-common/tool/filter.js";
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));

//--------  注册字体图标库组件 ---------------
import AppIcon from "cloud-common/business/AppIcon";
import "cloud-common/assets/fonts/iconfont.js";
Vue.component("app-icon", AppIcon);

import { CloudLoading, CloudMessage, CloudConfirm } from "cloud-components";

Vue.use(CloudLoading);
Vue.use(CloudMessage);
Vue.use(CloudConfirm);

Vue.config.productionTip = false;
localStorage.removeItem("i18n_DATA"); //删除v5国际化
new Vue({
  router,
  store,
  render: h => h(App),
}).$mount("#main-container");

//引入前端监控探针
new CloudMonitor({
  enableSPA: true,
  token: "1",
  appVersion: "云设计-v1.1.3",
  reportUrl: `${process.env.VUE_APP_monitorUrl}/server/report.png`, //http://localhost:3000/server/report
  ignore: {
    ignoreErrors: [],
    ignoreUrls: [],
    ignoreApis: [
      "api.growingio.com/v2/9ecbcc8602c0d685/web/pv",
      "livereload.js?snipver=1",
      "/sockjs-node/info",
    ],
  },
  behavior: {
    console: ["error"], // 取值可以是"debug", "info", "warn", "log", "error"
    click: false,
  },
});

// 验证登陆并启动微应用
// microAppStart();
